import 'package:equatable/equatable.dart';
import 'package:backend.core/core/domain/entities/web/web_money_amount.dart';
import 'package:backend.core/core/domain/entities/web/web_transaction.dart';
import 'package:backend.core/core/domain/entities/web/yookassa/yookassa_transaction_revocation_info.dart';

abstract class YookassaTransaction extends Equatable implements WebTransaction {
  const YookassaTransaction();

  String get yookassaPaymentId;

  WebMoneyAmount get incomeAmount;

  YookassaTransactionRevocationInfo? get revocationInfo;

  @override
  bool get revoked {
    return revocationInfo != null;
  }

  YookassaTransaction copyWith({
    String Function()? id,
    String Function()? userId,
    String Function()? purchaseItemSku,
    String Function()? paymentMethodId,
    DateTime Function()? time,
    WebMoneyAmount Function()? amount,
    YookassaTransactionRevocationInfo? Function()? revocationInfo,
    bool Function()? test,
    String Function()? yookassaPaymentId,
    WebMoneyAmount Function()? incomeAmount,
  });
}
